"""
此代码列出了屏幕的常用绘图函数。
"""

import sensor
import image
import lcd


def camera_init():
  sensor.reset()
  sensor.set_pixformat(sensor.RGB565)
  sensor.set_framesize(sensor.QVGA)
  sensor.skip_frames(10)
  sensor.run(1)


lcd.init(freq=15000000, color=65535, invert=1)
lcd.rotation(2)
camera_init()
sensor.set_windowing((320, 240))
sensor.set_vflip(1)
sensor.set_hmirror(1)

while True:
  img = sensor.snapshot()#获取一张照片
  img = img.draw_string([0,0][0],[0,0][1],"GUET_2022",(0,0,255),5,mono_space=0)#画字符串
  #img = img.draw_line([160,140,160,240],(0,0,255),1)    #画线
  img = img.draw_cross([160,120],(0,0,255),30,3)         #画十字
  img = img.draw_image(img,[20,60],[0.3,0.3][0],[0.3,0.3][1])   #画图像
  img = img.draw_image(img,[200,60],[0.3,0.3][0],[0.3,0.3][1])  #画图像
  img = img.draw_circle([160,120,30],(255,0,0),4,0)	#画圆形
  img = img.draw_arrow([0,0,160,120],(0,255,0),4)	#绘制箭头
  img = img.draw_rectangle([120,100,80,40],(0,0,255),1,0)	#绘制矩形
  lcd.display(img)
